<template>
  <common-detail-list title="历史记录">
    <el-button slot="header" @click="back">返回</el-button>

    <common-search slot="search" @search="handleQuery" @reset="resetQuery">
      <el-form
        :model="query"
        ref="queryForm"
        v-show="showSearch"
        :inline="true"
        @submit.native.prevent
        label-width="62px"
      >
        <el-form-item label="发送时间">
          <el-date-picker
            v-model="query.daterange"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            value-format="yyyy-MM-dd"
            format="yyyy-MM-dd"
            align="right"
          ></el-date-picker>
        </el-form-item>

        <el-form-item label="发送状态">
          <el-select v-model="query.existOrder">
            <el-option label="全部" :value="null"></el-option>
            <el-option label="有" value="0"></el-option>
            <el-option label="无" value="1"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
    </common-search>

    <common-table slot="content" v-loading="loading" :data="list">
      <el-table-column label="发送时间" align="left" prop="assetId">
        <template slot-scope="{ row }">{{ row.assetId }}</template>
      </el-table-column>

      <el-table-column label="发送状态" align="left" prop="systemName">
        <template slot-scope="{ row }">{{ row.systemName }}</template>
      </el-table-column>

      <el-table-column label="失败原因" align="left" prop="collectTime">
        <template slot-scope="{ row }">{{ row.collectTime }}</template>
      </el-table-column>
    </common-table>
    <pagination
      slot="pagination"
      v-show="total > 0"
      :total="total"
      :page.sync="query.pageNum"
      :limit.sync="query.pageSize"
      @pagination="getList"
    />
  </common-detail-list>
</template>

<script>
import { record_list } from "@/api/management/system/system.js";

export default {
  components: {},
  props: {
    
  },
  data() {
    return {
      total: 0, // 总条数
      loading: false, // table 加载中
      showSearch: true,
      dialogShow: false,
      showItem: {},
      list: [], // 数据列
      thresholdList: [], //阀值列表
      query: {
        pageNum: 1,
        pageSize: 10,
      }, // 查询条件
    };
  },
  watch: {},
  computed: {},
  methods: {
    back() {
      this.$emit("back");
    },
    /**
     * 获取列表
     */
    getList() {
      //   this.loading = true;
      let query = { ...this.query };
      //   record_list(query).then((res) => {
      //     this.list = res.rows;
      //     this.total = res.total;
      //     this.loading = false;
      //   });
    },
    /**
     * 查询
     */
    handleQuery() {
      if (!!this.query.daterange) {
        this.query.beginTime = this.query.daterange[0];
        this.query.endTime = this.query.daterange[1];
      } else {
        this.query.beginTime = "";
        this.query.endTime = "";
      }
      this.query.pageNum = 1;
      this.getList();
    },
    /**
     * 重置查询
     */
    resetQuery() {
      this.query = this.$options.data().query;
      this.$refs.commonDept.clearDept();
      // this.getList()
    },
  },
  created() {
    this.getList();
  },
  mounted() {},
};
</script>
<style lang="scss" scoped>
</style>
